<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>


<div id="Page-content">

	<s:if test="%{#request.cart.cartDetails == null}">
		<div style="font-size: 20px; font-weight: bold; margin: 20px">
		 	No exist cart details !!!
		 </div>
	</s:if>
	<s:else>
		<div style="font-size: 20px; font-weight: bold; margin: 20px"> View cart detail </div>
		<table style="text-align: center; margin: 20px">
			<tr>
				<th style="text-align: center; font-size: 20px; font-weight: bold">N.Order</th>
				<th style="text-align: center; font-size: 20px; font-weight: bold">Picture</th>
				<th style="text-align: center; font-size: 20px; font-weight: bold">Name</th>
				<th style="text-align: center; font-size: 20px; font-weight: bold">Price</th>
				<th style="text-align: center; font-size: 20px; font-weight: bold">Quantity</th>
			</tr>
			
			<s:iterator status="cartdetail" value="#request.cart.cartDetails">
				<tr>
					<td style="text-align: center; font-size: 12px; font-weight: bold">
						<s:property value="#cartdetail.index+1" />
					</td>
					
					<td>
						<s:url value="%{'/' + imageUrl}" var="urlTag" namespace="/" />
						<img src="<s:property value="#urlTag"/>" width="100" height="100" />
					</td>
					
					<td style="text-align: center; font-size: 12px; font-weight: bold">
						<s:property value="nameProduct" />
					</td>
					
					<td style="text-align: center; font-size: 12px; font-weight: bold">
						<s:property value="price" /> $
					</td>
					
					<td style="text-align: center; font-size: 12px; font-weight: bold">
						<s:property value="quantity" />
					</td>
					
				</tr>
			</s:iterator>
			
		</table>
	</s:else>
</div>
